<template>
	<view>
		<!-- 头像 -->
		<view class="top">
			<view class="user-img">
				<image :src="cover"></image>
			</view>
		</view>
		<!-- 详情页 -->
		<view class="menu">
			<view class="item" @click="toMyInfo">我的信息</view>
			<view class="item" @click="toMyResume">我的简历</view>
			<view class="item">查看简历</view>
			<view class="item" @click="toAboutUs">关于我们</view>
			<view class="item" @click="toLogOut">切换账号</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				cover: ''
			}
		},
		onLoad() {
			uni.setNavigationBarColor({
				frontColor: "#000000",
				backgroundColor: '#00b4b3'
			});
			if(!this.$store.state.isLogin){
				console.log("没登陆")
				this.$u.route('/pages/login/login')
			}
			this.cover = this.$store.state.user.cover
		},
		onShow() {
			this.cover = this.$store.state.user.cover
		},
		methods: {
			toMyResume(){
				this.$u.route('/pages/myResume/myResume')
			},
			toAboutUs(){
				this.$u.route('/pages/aboutUs/aboutUs')
			},
			toMyInfo(){
				this.$u.route('/pages/myInfo/myInfo',{
					id: 0,
					user_id: this.$store.state.user._id
				})
			},
			toLogOut(){
				this.$u.route('/pages/index/index')
				location.reload()
				this.$store.state.isLogin = false
			}
		}
	}
</script>

<style lang="scss">
.top{
	// background: $boss-base-color;
	background: #3A4861;
	width: 100%;
	padding: 30rpx 0;
}
.top .user-img{
	width: 252rpx;
	margin: 0 auto;
}
.top image{
	width: 252rpx;
	height: 252rpx;
	border-radius: 20%;
	border: 6rpx solid #777F92;
}
.menu .item{
	height: 96rpx;
	line-height: 96rpx;
	border-bottom: 2rpx solid #ccc;
	padding: 0 40rpx;
	font-size: 34rpx;
	text-align: center;
}
</style>
